<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<%@ page import="com.cg.slms.domain.*,java.util.*"%>
<%@ taglib prefix="form" uri="http://www.springframework.org/tags/form"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<!DOCTYPE html>
<%
	String path = request.getContextPath();
	String basePath = request.getScheme() + "://"
			+ request.getServerName() + ":" + request.getServerPort()
			+ path + "/";
%>
<%  

if (request.getAttribute("stockorder") == null) {
	Stockorder stockorder = new Stockorder();
	stockorder.setMerchandise(new Merchandise());
	stockorder.setClient(new Client());
	stockorder.setEmployee(new Employee());
	request.setAttribute("stockorder", stockorder);
}
%>

<html>
<head>
<base href="<%=basePath%>" />
<meta charset="UTF-8">
<title>添加订单</title>
<link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/bootstrap/4.3.1/css/bootstrap.min.css" integrity="sha384-ggOyR0iXCbMQv3Xipma34MD+dH/1fQ784/j6cY/iJTQUOhcWr7x9JvoRxT2MZw1T" crossorigin="anonymous">

<script language="javascript" src="script/main.js"></script>
<script language="javascript" src="script/calendar5.js"></script>
<script type="text/javascript">
    var c = new Calendar("c");                     
    document.write(c);
</script>  
</head>
<body>
<p><font style="font-size:20px;margin-left:450px;position:relative;top:50px">进货管理→订货单→添加订货单</font></p>
<form:form action="addStockorderAction" method="post" name="stockorder" modelAttribute="stockorder">
<br><br><br>
	<table border="0" cellpadding="1" cellspacing="1" width="95%">
		<tr>
			<td align="right" width="10%" nowrap="nowrap">订货单编号</td>
			<td width="20%">
				<form:input path="code" class="form-control"></form:input>
				<form:errors path="code" style="color:red"></form:errors>
			</td>
			<td align="right" width="10%" nowrap="nowrap">货物名称</td>
			<td width="20%">
				<form:select path="merchandise.id" items="${merchandises}"/>
			</td>
			<td align="right" width="10%">客户</td>
			<td width="20%">
				<form:select path="client.id" items="${clients}"/>
			</td>
			<td width="10%">&nbsp;</td>
		</tr>
		<tr>
			<td align="right" width="10%" nowrap="nowrap" style="position:relative;top:30px">订单数量</td>
			<td width="20%">
				<form:input path="merchandisenumber"  class="form-control" style="position:relative;top:30px" ></form:input>
			</td>
	        <td width="10%">&nbsp;</td>
		</tr>
		<tr>
			<td align="right" width="10%" nowrap="nowrap" style="position:relative;top:60px">订货日期</td>
			<td width="20%">
				<form:input path="orderdate" class="form-control" style="position:relative;top:60px" onclick="c.show(this);"/>
			</td>
			<td align="right" nowrap="nowrap" style="position:relative;top:60px">经手人</td>
			<td>
				<form:select path="employee.id" items="${employees}" style="position:relative;top:60px"/>
			</td>
			<td align="right">&nbsp;</td>
			<td>&nbsp;</td>
			<td>&nbsp;</td>
		</tr>
	</table>

	<p></p>
	<div style="margin-left: 30px; margin-right: 0px" >
	<table border="0" cellpadding="0" cellspacing="0" width="95%" style="position:relative;left:450px;top:100px">
		<tr>
			<td width="10%">
				<input type="submit" value="新增" class="btn btn-info" />
			</td>
			<td width="10%">
				<a href="preStockorderAction" class="btn btn-info">返回</a>
			</td>
			<td width="80%">&nbsp;</td>
		</tr>
	</table>
	</div>
	
</form:form>
</body>
</html>